package homework;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Vector;

public class homework_IO {

	public static void main(String[] args) {
		FileInputStream fis= null;
		
		String str=new String();
		int data=0;
		int count=0;
		int Find=0;
		Vector<Integer> vect=new Vector<Integer>();
		try
		{
			fis=new FileInputStream("Aryticle.txt");
			while( ((data= fis.read()) != -1) )
			{
				str+=(Character.toString((char)data));
				count++;
				if((data)=='p')
					vect.add(count);
			}
		}
		catch(IOException ioe)
		{
			ioe.printStackTrace();
		}
		for(int i=0; i<vect.size(); i++)
		{
			if(str.substring(vect.get(i)-1, vect.get(i)+5).equals("people"))
				Find++;
		}	
		System.out.println(Find);
		try
		{
			if(fis!= null)
				fis.close();
		}
		catch(IOException ioe)
		{
			ioe.printStackTrace();
		}		
	}
}